<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.5.1/jquery.js"></script>
    <script>
        function a() {
            $.get({
                url: "http://localhost:8080/SpringMVC_02_war_exploded/saxon",
                data: {"userName": $("#userName").val()},
                success: function (data) {
                    if (data=="true"){
                        $("#username-span").text("ok");
                        $("#username-span").css("color","green");
                    }
                }
            })
        }
    </script>
    <title>Title</title>
</head>
<body>
<form action="${pageContext.request.contextPath}/saxon" method="post">
    用户名：<input type="text" id="userName" name="userName" value="" onblur="a()">
    <span id="username-span"></span>
</form>
</body>
</html>
